﻿using Hopscotch.Presentation.QuickSearchModule.Views;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using System;

namespace Hopscotch.Presentation.QuickSearchModule
{
    public class Module : IModule
    {
        private readonly IRegionViewRegistry regionViewRegistry;

        public Module(IRegionViewRegistry registry)
        {
            this.regionViewRegistry = registry;
        }

        public void Initialize()
        {
            // Register other view objects with DI Container (Unity)
            var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
            container.RegisterType<Object, QuickSearchView>(typeof(QuickSearchView).Name);

            // Show Quick-search Ribbon Group
            //var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            //var view = container.Resolve<QuickSearchView>();
            //regionManager.AddToRegion(RegionNames.SearchRegion, view);
        }
    }
}
